package com.ruoyi.exam.mapper;

import com.ruoyi.exam.domain.PQuestion;
import com.ruoyi.exam.vo.*;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * 试题Mapper接口
 *
 * @author ruoyi
 * @date 2021-12-31
 */
public interface PQuestionMapper
{
    /**
     * 查询试题
     *
     * @param id 试题主键
     * @return 试题
     */
    public PQuestion selectPQuestionById(Long id);

    /**
     * 查询试题列表
     *
     * @param pQuestion 试题
     * @return 试题集合
     */
    public List<PQuestion> selectPQuestionList(PQuestion pQuestion);

    /**
     * 新增试题
     *
     * @param pQuestion 试题
     * @return 结果
     */
    public int insertPQuestion(PQuestion pQuestion);

    /**
     * 修改试题
     *
     * @param pQuestion 试题
     * @return 结果
     */
    public int updatePQuestion(PQuestion pQuestion);

    /**
     * 删除试题
     *
     * @param id 试题主键
     * @return 结果
     */
    public int deletePQuestionById(Long id);

    /**
     * 批量删除试题
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deletePQuestionByIds(Long[] ids);

    /**
     * 获取B型题ID
     * @return
     */
    public PQuestion getToList();


    /**
     * 查询试题列表
     *
     * @param pQuestion 试题
     * @return 试题集合
     */
    public List<QuestionListVo> selectPQuestionListVo(PQuestion pQuestion);


    public List<SQuestionResult> randomQuestionList(StudentQuestionVo studentQuestionVo);
    public List<SQuestionResult> findByBQuestion(StudentQuestionVo studentQuestionVo);

    public List<SQuestionResult>selectSQuestionList(StudentQuestionVo studentQuestionVo);

    public List<PQuestion> getQuBankIdList(Long[] ids);

    public List<PQuestion> getQuBankId(Long[] ids);

    List<PQuestion> getParentByParentId(String[] QuParentId);

    public List<PQuestion> selectQuParentId(String[] id);
    public List<PQuestion> selectGroupByQuParentId(String[] id);



    public List<BQuestionResult> findByBQuestionInfo(StudentQuestionVo studentQuestionVo);

    int selectCountQuestionByType(Integer typeId);

    List<PQuestion> selectPQuestionByIds(Long[] ids);
}
